﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>邯郸市公安局峰峰矿区分局</title>
    <!-- <link rel="stylesheet" href="./css/reset.css"> -->
    <link rel="stylesheet" href="./css/detail.css">

    <script src="./libs/jquery-1.9.1.min.js"></script>
    <script src="./libs/jquery.jDiaporama.js"></script>
    <script src="./libs/jquery.SuperSlide.2.1.1.js"></script>
    <script src="./libs/jquery.getParame.js"></script>
    <script src="./libs/jrender.min.js"></script>
    <script src="./js/config.js"></script>
    <script src="./libs/jquery.cookie.js"></script>
    <!-- <script src="../config.js"></script> -->
    <!--[if IE 7]>
            <link rel="stylesheet" href="css/ie7.css">
    <![endif]-->
    <!--[if IE 8]>
            <link rel="stylesheet" href="css/ie8.css">
    <![endif]-->
</head>

<body>
    <!-- 背景 -->
    <div class="s-bg-box">
        <img class="bg-img-1" src="./images/bg/bg-1.jpg" alt="">
        <img class="bg-img-2" style="display:none" src="./images/bg/bg-2.jpg" alt="">
        <img class="bg-img-3" style="display:none" src="./images/bg/bg-3.jpg" alt="">
        <img class="bg-img-4" style="display:none" src="./images/bg/bg-4.jpg" alt="">
    </div>

    <script>
        $(function () {

            var i = 1;
            setInterval(function () {
                $('.s-bg-box').fadeOut('slow', function () {
                    $('.bg-img-' + i).hide();
                    i++;
                    if (i >= 5) {
                        i = 1;
                    }
                    $('.bg-img-' + i).show();

                    // $('.s-bg-box img').attr('src', './images/bg/bg-' + i + '.jpg');
                    $('.s-bg-box').fadeIn('slow');
                });
            }, 12000);
        });
    </script>


    <div class="s-content-box">

        <!-- 头部 -->
        <div class="s-header-box">
            <div class="s-logo-box"></div>
        </div>


        <!-- nav模板引擎 -->
        <script type="text/x-jsrender" id="nav-specCard">
            {{for return_body}} {{if #getIndex()
            <11}} <li class="" lmid="{{:content}}">
                <a href="{{:url}}" target="_blank">{{:title}}</a>
                </li>
                {{/if}} {{/for}}
        </script>

        <!-- nav -->
        <div class="s-nav-box">
            <ul class="left-box" id="nav-box">
                <li class="active">
                    <a href="">加载中...</a>
                </li>

            </ul>
            <div class="search-input-box">
                <input type="text" id="search-input" class="search-input" placeholder="站内搜索" />
                <div class="search-btn"></div>
            </div>
            <label for="search-input" class="search-lable">站内搜索</label>
            <script>
                $('.search-btn').on('click', function () {
                    var search_val = $('#search-input').val();
                    if (!search_val) {
                        return;
                    }
                    $('#search-input').val('');
                    window.open(encodeURI('/app/search.html?title=' + search_val));

                });
            </script>
        </div>


        <!-- 内容1部分 -->
        <div class="s-model-content-box">
            <div class="s-insert-content-box">
                <div class="s-top-box">
                    <span class="line"></span>
                    当前位置:
                    <a href="/app/" target="_blank">首页</a>
                    &gt;&gt;

                    <a href="#" id="second-link">栏目</a>
                    &gt;&gt;

                    <a href="#">正文</a>

                </div>
                <div class="dished-line"></div>

                <div class="s-bottom-box" id="content-box">
                    <h1 class="title">标题加载中...</h1>

                    <div class="content">
                        <div class="main-aticle">
                            内容加载中...
                        </div>
                    </div>
                </div>

                <div class="s-qianshou-box">
                    <div class="s-qianshou-title">
                        <img class="g-qs-icon" src="./images/icon-qianshou.png"> &nbsp;&nbsp;&nbsp;文件签收
                    </div>

                    <!-- <div class="s-qianshou-status">
                        <div class="s-qianshou-qingkuang">签收状态: 已签收
                            <span>6</span>个单位</div>
                        <div class="s-qianshou-zhuangtai">签收状态:
                            <span>正待签收中</span>
                        </div>
                    </div> -->


                    <!-- 未登录时显示 -->
                    <div class="g-weidenglu-content">
                        <!-- <div class="s-check-login-msg">
                            您当前处于未登录状态，请先登录后再签收文件!
                        </div> -->

                        <div class="s-login-box">
                            <span class="g-qs-text">用户名:</span>
                            <input type="text" class="g-qs-input" id="user-input">
                            <span class="g-qs-text">密码:</span>
                            <input type="password" class="g-qs-input" id="password-input">
                            <span class="g-qs-text">真实姓名:</span>
                            <input type="text" class="g-qs-input" id="g-actual-name">

                            <input type="button" class="g-qs-login-btn" value="登陆并签收">

                        </div>
                    </div>

                    <!-- 登陆时显示 -->
                    <div class="s-yidenglu-content">
                        <!-- <div class="s-qianshou-liuyan">
                            留言:
                            <input type="text">
                            <input type="button" value="签收">
                        </div> -->
                        <div class="s-userinfo-box">
                            <span class="g-qs-text">当前用户:</span>
                            <span class="g-user-name">未知</span>
                            &nbsp;&nbsp;|&nbsp;&nbsp;
                            <span class="g-qs-text">真实姓名：</span>
                            <input type="text" class="g-qs-input" id="g-actual-name-span">
                            <input type="button" class="g-qs-btn" value="签收">
                            <span class="g-qs-text" id="g-new-password-text">&nbsp;&nbsp;|&nbsp;&nbsp;输入新的密码:</span>
                            <input type="text" class="g-qs-input" id="g-new-password">
                            <input type="button" class="g-qs-xg-qr-btn" value="确认修改">
                            <input type="button" class="g-qs-xg-btn" value="修改密码">
                            <input type="button" class="g-qs-logout" value="安全退出">

                        </div>

                    </div>

                    <!-- 签收信息 -->
                    <div class="g-qs-info-box">

                        <div class="g-qs-tlite">需签收单位/部门:</div>
                        <div>
                            <ul class="g-qs-info-ul" id="g-qs-ul-box">
                            </ul>

                        </div>
                    </div>
                    <div class="g-qs-details">
                        <img id="g-qs-xxxx-icon" src="./images/gengduo.png" alt=""> 查看详细信息
                    </div>

                    <div class="g-qs-info-table-box">

                        <table class="table" cellspacing="0" summary="The technical specifications of the Apple PowerMac G5 series">
                            <tr>
                                <th class="spec">序号</th>
                                <th>用户名</th>
                                <th>签收状态</th>
                                <th>签收人</th>
                                <th>签收时间</th>
                                <th>签收IP</th>
                                <th>邮箱</th>
                                <th>电话</th>

                            </tr>
                            <tbody id="g-qs-table-box">



                            </tbody>

                        </table>

                    </div>



                </div>

            </div>
        </div>

    </div>
    <script type="text/x-jsrender" id="content-specCard">
        <h1 class="title">{{:title}}</h1>
        <p class="detail-info">
            发布单位/部门：{{:zz}} &nbsp;&nbsp;&nbsp;&nbsp; 发布时间：{{timeFilter:time}} &nbsp;&nbsp;&nbsp;&nbsp;浏览次数：{{:hit}} 
        </p>
        <div class="content">
            <div class="main-aticle">
                {{:content}}
            </div>
        </div>
        </div>
    </script>

    <script>
        $(function () {
            $.views.converters("timeFilter", function (val) {
                var fmt = "yyyy-MM-dd hh:mm:ss";
                var data = new Date(val);

                var o = {
                    "M+": data.getMonth() + 1, //月份 
                    "d+": data.getDate(), //日 
                    "h+": data.getHours(), //小时 
                    "m+": data.getMinutes(), //分 
                    "s+": data.getSeconds(), //秒 
                    "q+": Math.floor((data.getMonth() + 3) / 3), //季度 
                    "S": data.getMilliseconds() //毫秒 
                };

                if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (data.getFullYear() + "").substr(4 -
                    RegExp.$1.length));
                for (var k in o)
                    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length ==
                        1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
                return fmt;
            });

            // alert(returnCitySN['cip'] + returnCitySN['cname']);
            $(".s-qianshou-box").hide();
            $('#g-new-password-text').hide();
            $('#g-new-password').hide();
            $('.g-qs-xg-qr-btn').hide();
            $('.g-qs-info-table-box').hide();

            // 显示详细列表
            var isShowAndHide = true;
            $('.g-qs-details').on('click', function () {

                if (isShowAndHide) {
                    $('.g-qs-info-table-box').show();
                    $('#g-qs-xxxx-icon').attr("src", "./images/shouqi.png");
                    isShowAndHide = false;
                } else {
                    $('.g-qs-info-table-box').hide();
                    $('#g-qs-xxxx-icon').attr("src", "./images/gengduo.png");
                    isShowAndHide = true;
                }

            })
            $('.g-qs-logout').on('click', function () {

                $.cookie('gn_qs_userObj', null, {
                    expires: -1,
                    path: '/'
                });
                $('.s-yidenglu-content').hide();
                $('.g-weidenglu-content').show();



            })

            // 签收登陆
            $('.g-qs-login-btn').on('click', function () {
                var user_name = $('#user-input').val();
                var user_password = $('#password-input').val();
                var actual_name = $('#g-actual-name').val();
                if (user_name && user_password && actual_name) {
                    $.ajax({
                        type: 'POST',
                        url: $.webConfig.apiUrl + 'xsuser/loginxs',
                        data: {
                            username: user_name,
                            password: user_password
                        },
                        cache: false,
                        dataType: 'json',
                        success: function (data) {
                            if (data['return_code'] == 1) {
                                data['return_body'].actualname = actual_name;
                                $.cookie('gn_qs_userObj', JSON.stringify(data[
                                    'return_body']), {
                                    expires: 7,
                                    path: '/'
                                });
                                // 调用签收方法
                                qianshoufunc(user_name, data['return_body']['id'],
                                    actual_name);
                            } else {
                                alert(data['return_msg']);
                            }
                        },
                        error: function (err) {
                            alert('服务器出小差咯...');
                        }
                    })

                } else {
                    alert('用户名|密码|真实姓名未正确填写');
                }


            })

            $('.g-qs-btn').on('click', function () {


                var actual_name = $('#g-actual-name-span').val();
                if (actual_name) {
                    if ($.cookie('gn_qs_userObj')) {
                        var user_obj = $.parseJSON($.cookie('gn_qs_userObj'));
                        qianshoufunc(user_obj['username'], user_obj['id'], actual_name);


                    } else {
                        alert('登陆失效，请重新登陆')
                        $('.s-yidenglu-content').hide();
                    }

                } else {
                    alert('请正确填写真实姓名')

                }



            })
            //修改密码
            $('.g-qs-xg-btn').on('click', function () {

                // int id,String username,String password,String Email,String QQ
                $('#g-new-password-text').show();
                $('#g-new-password').show();
                $('.g-qs-xg-qr-btn').show();
                $('.g-qs-xg-btn').hide();



            })

            $('.g-qs-xg-qr-btn').on('click', function () {

                var newpassword = $('#g-new-password').val();
                if (!newpassword) {

                    alert('请输入新的密码')
                    return;
                }

                if ($.cookie('gn_qs_userObj')) {

                    var user_obj = $.parseJSON($.cookie('gn_qs_userObj'));

                    $.ajax({
                        type: 'POST',
                        url: $.webConfig.apiUrl + 'xsuser/updatexs',
                        data: {
                            id: user_obj['id'],
                            username: user_obj['username'],
                            password: newpassword,
                            Email: user_obj['email'],
                            QQ: user_obj['qq']
                        },
                        cache: false,
                        dataType: 'json',
                        success: function (data) {
                            if (data['return_code'] == 1) {
                                alert(data['return_msg']);

                                $('#g-new-password-text').hide();
                                $('#g-new-password').hide();
                                $('.g-qs-xg-qr-btn').hide();
                                $('.g-qs-xg-btn').show();

                            } else {
                                alert(data['return_msg']);
                            }
                        },
                        error: function (err) {
                            alert('服务器出小差咯...');
                        }
                    })
                }

            })

            // 签收文件方法
            function qianshoufunc(username, userId, actualname) {

                $.ajax({
                    type: 'POST',
                    url: $.webConfig.apiUrl + 'qs/addqs',
                    data: {
                        NewsID: $.getUrlParam('articleid'),
                        Username: username,
                        content: actualname,
                        userId: userId,
                        addIP: '暂时无法获取IP'
                    },
                    cache: false,
                    dataType: 'json',
                    success: function (data) {
                        if (data['return_code'] == 1) {
                            getqslist();
                            $('.g-weidenglu-content').hide();
                            $('.s-yidenglu-content').show();
                            $('.g-qs-btn').val('签收成功');
                            $('.g-qs-btn').attr('disabled', true);
                            $('#g-actual-name-span').val(actualname)
                            $('.g-user-name').text(username);

                        } else if (data['return_code'] == 2) {

                            $('.g-weidenglu-content').hide();
                            $('.s-yidenglu-content').show();
                            $('.g-qs-btn').val('已签收');
                            $('.g-qs-btn').attr('disabled', true);

                            $('.g-user-name').text(username);

                        } else {
                            alert(data['return_msg']);
                        }
                    },
                    error: function (err) {
                        alert('服务器出小差咯...');
                    }
                })
            }

            //获取新闻
            var id = $.getUrlParam('articleid');
            if (!id) {
                alert('参数错误');
            }
            $.ajax({
                type: 'post',
                url: $.webConfig.apiUrl + 'news/querynewsid',
                data: {
                    id: id
                },
                dataType: 'json',
                success: function (data) {
                    if (data['return_code'] == 1) {
                        if (data['return_body'][0]['qianShou'] == 1) {
                            verifyLogin();
                            getqslist();
                            $(".s-qianshou-box").show();
                        }

                        setTimeout(function () {
                            $('#second-link').attr('href', "/app/sub.html?lmid=" + data[
                                'return_body'][
                                0
                            ]['lm']);
                            //获取模板
                            var jsRenderTpl = $.templates('#content-specCard');
                            //模板与数据结合
                            var finalTplCon = jsRenderTpl(data['return_body']);
                            $("#content-box")[0].innerHTML = finalTplCon;
                        }, 0);

                    }
                },
                error: function (err) {}
            });

            function verifyLogin() {
                if ($.cookie('gn_qs_userObj')) {

                    var user_obj = $.parseJSON($.cookie('gn_qs_userObj'));
                    $.ajax({
                        type: 'POST',
                        url: $.webConfig.apiUrl + 'xsuser/loginxs',
                        data: {
                            username: user_obj['username'],
                            password: user_obj['password']
                        },
                        cache: false,
                        dataType: 'json',
                        success: function (data) {
                            if (data['return_code'] == 1) {
                                $.cookie('gn_qs_userObj', JSON.stringify(data[
                                    'return_body']), {
                                    expires: 7,
                                    path: '/'
                                });
                                $('.g-user-name').text(user_obj['username']);
                                $('.g-weidenglu-content').hide();
                            } else {
                                $('.s-yidenglu-content').hide();
                            }
                        },
                        error: function (err) {
                            alert('服务器出小差咯...');
                        }
                    })
                } else {
                    $('.s-yidenglu-content').hide();
                }
            }


            // 获取签收列表

            function getqslist() {

                $.ajax({
                    type: 'post',
                    url: $.webConfig.apiUrl + 'qs/getQDList',
                    data: {
                        id: $.getUrlParam('articleid')
                    },
                    dataType: 'json',
                    success: function (data) {
                        if (data['return_code'] == 1) {
                            var data_obj = data['return_body']
                            //获取模板
                            var jsRenderTpl1 = $.templates('#ul-list-specCard');
                            //末班与数据结合
                            var finalTpl1 = jsRenderTpl1(data_obj);
                            $('#g-qs-ul-box').html(finalTpl1);

                            //获取模板
                            var jsRenderTpl2 = $.templates('#table-list-specCard');
                            //末班与数据结合
                            var finalTpl2 = jsRenderTpl2(data_obj);
                            $('#g-qs-table-box').html(finalTpl2);
                        }
                    },
                    error: function (err) {}
                });



            }


        });
    </script>

    <script type="text/x-jsrender" id="ul-list-specCard">
        {{for #data}} {{if type == 1}}
        <li>
            <img class="g-qs-info-icon" src="./images/yiqianshou.png">
            <span class="g-qs-info-name">{{:username}}</span>
        </li>
        {{else}}
        <li>
            <img class="g-qs-info-icon" src="./images/weiqianshou.png">
            <span class="g-qs-info-name">{{:username}}</span>
        </li>

        {{/if}} {{/for}}

    </script>
    <script type="text/x-jsrender" id="table-list-specCard">

        {{for #data}} {{if #getIndex()%2 == 0}}
        <tr>
            <td>{{:#getIndex()+1}}</td>
            <td>{{:username}}</td>
            {{if type == 1}}
            <td>已签收</td>
            <td>{{:content}}</td>
            <td>{{:addtime}}</td>
            <td>{{:addIp}}</td>

            {{else}}
            <td style="color:red">未签收</td>
            <td></td>
            <td></td>
            <td></td>

            {{/if}}

            <td>{{:email}}</td>
            <td>{{:qq}}</td>
        </tr>
        {{else}}
        <tr class="select">
            <td>{{:#getIndex()+1}}</td>
            <td>{{:username}}</td>
            {{if type == 1}}
            <td>已签收</td>
            <td>{{:content}}</td>
            <td>{{:addtime}}</td>
            <td>{{:addIp}}</td>

            {{else}}
            <td style="color:red">未签收</td>
            <td></td>
            <td></td>
            <td></td>

            {{/if}}

            <td>{{:email}}</td>
            <td>{{:qq}}</td>
        </tr>
        {{/if}} {{/for}}

    </script>


    <!-- <script type="text/x-jsrender" id="youqing-specCard">
        {{for return_body}} {{if picClassify == 3}}

        <li class="g-foot-nav-li">
            <a href="{{:jumpPath}}" style="width:100%;height:100%;display:block;">
                <img width="100%" height="100%" src="{{:picUrl}}" alt="{{:title}}">
            </a>
        </li>
        {{/if}} {{/for}}
    </script> -->

    <!-- footer nav -->
    <!-- <div class="g-foot-nav-box">
        <ul class="g-foot-nav-ul" id="youqing-box">
            <li class="g-foot-nav-li">
                加载中...
            </li>
        </ul>
    </div> -->


    </div>

    <!-- 图片接口 -->
    <!-- <script>
        $(function () {
            // 获取轮播图
            $.ajax({
                type: 'post',
                url: $.webConfig.apiUrl + 'picture/getListPicture',
                dataType: 'json',
                success: function (data) {
                    // console.log(data);
                    if (data['return_code'] == 1) {

                        // 友情
                        var jsRenderTplYq = $.templates('#youqing-specCard');
                        //末班与数据结合
                        var finalTplYq = jsRenderTplYq(data);
                        $('#youqing-box').html(finalTplYq);

                    }
                },
                error: function (err) {
                    // console.log(err);
                }
            });
        })
    </script> -->


    </div>

    <!-- footer -->
    <div class="s-footer-box">
        <div class="s-footer-logo"></div>

        <!-- footer模板引擎 -->
        <script type="text/x-jsrender" id="footer-specCard">
            <p class="s-footer-content1">
                <span class="left">版权所有: {{:bqsy}}</span>
                <span class="right">地址：{{:dz}}</span>
            </p>
            <p class="s-footer-content2">
                <span class="left">负责人：{{:fzr}}</span>
                <span class="right">维护人：{{:whr}}</span>
            </p>
            <p class="s-footer-content2">
                <span class="left">电话：{{:dh}}</span>
                <span class="right">报警电话：{{:bjdh}}</span>
            </p>

            <p class="s-footer-content2">
                <a href="/app/IE8cn_XP.exe" style="text-decoration:none;color:#fff">【IE浏览器下载】</a>
                <a href="/app/login.html" style="text-decoration:none;color:#fff" target="_blank">| 后台链接</a>
            </p>

            <div class="s-footer-content3">
                <span class="text">
                    <!-- {{:bah}} -->
                </span>
            </div>

            <!-- footerlogo -->
            <!-- <div class="s-footer-icon">
                <div class="s-footer-icon-1"></div>
                <div class="s-footer-icon-2"></div>
            </div> -->
        </script>


        <div class="s-footer-content-box" id="footer-box">

            <p class="s-footer-content1">
                <span class="left">版权所有: 加载中...</span>
                <span class="right">地址：加载中...</span>
            </p>
            <p class="s-footer-content2">
                <span class="left">负责人：加载中...</span>
                <span class="right">维护人：加载中...</span>
            </p>
            <p class="s-footer-content2">
                <span class="left">电话：加载中...</span>
                <span class="right">报警电话：加载中...</span>
            </p>

            <p class="s-footer-content2">
                <a href="/app/IE8cn_XP.exe" style="text-decoration:none;color:#fff">【IE浏览器下载】</a>
                <a href="/app/login.html" style="text-decoration:none;color:#fff" target="_blank">| 后台链接</a>
            </p>

            <div class="s-footer-content3">
                <span class="text">
                     
                </span>
            </div>

            <!-- footerlogo -->
            <!-- <div class="s-footer-icon">
                <div class="s-footer-icon-1"></div>
                <div class="s-footer-icon-2"></div>
            </div> -->


        </div>




    </div>
</body>
<script src="./js/common.js"></script>

</html>